package com.ruoyi.group.controller;

import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.group.domain.RpCommunication;
import com.ruoyi.group.service.replyDtailsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/listPages/reply")
public class replyDtails extends BaseController {
    @Autowired(required = false)
    replyDtailsService replyDtailsService;
    /**
     * 回复查询repairId
     * @param
     * @return
     */
//    @PreAuthorize("@ss.hasPermi('listPage:reply:query')")
    @GetMapping("/{repairId}")
    public AjaxResult replyFind(@PathVariable Integer repairId){
        System.out.println(repairId);
       return AjaxResult.success(replyDtailsService.findReply(repairId));
    }
    /**
     * 回复反馈
     */
    @PreAuthorize("@ss.hasPermi('listPage:listPage:add')")
    @Log(title = "新增回复", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult addFeedBack(@RequestBody RpCommunication rpCommunication){

        return toAjax(replyDtailsService.addReplyBack(rpCommunication));
    }
    /**
     * 全部沟通记录
     */

}
